home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Scheduling / Cassandra / Source / AddEvent.h < prev    next >
Encoding:
Text File  |  1991-11-01  |  6.6 KB  |  219 lines

  1. //
  2. // AddEvent.h
  3. // Copyright (c) 1989, 1990 by Jiro Nakamura 
  4. // All rights reserved
  5. //
  6. // Interface definition of the AddEvent class.
  7. //
  8. // AddEvent -> Derived from Panel
  9. // The Class AddEvent handles the AddEvent Panel for Cassandra and is
  10. // also the superclass of the EditEvent Class which handles the
  11. // EditEvent Panel. Both of these classes interpret the user's interactions
  12. // with the panel (as supplied in the .nib file by IB) into an Event
  13. // which can be inserted (in the case of AddEvent) into the event queue
  14. // using the Event class.
  15. //
  16. // RCS Information
  17. // Original Author:    Jiro Nakamura    ac6y@vax5.cit.cornell.edu
  18. // Revision Number->    $Revision: 2.2 $
  19. // Last Revised->    $Date: 91/11/01 17:23:30 $
  20. //
  21.  
  22. #import <appkit/Panel.h>
  23. #import <soundkit/Sound.h>
  24. #import "Event.h"
  25.  
  26. #define AM    0
  27. #define PM    1
  28.  
  29. @interface AddEvent:Panel
  30. {
  31.     // Private Instance Variables
  32.     Event *ev;                // A handle to the Event class
  33.     Sound *soundfile;            // A place to put the sound
  34.     float oldVolumeLeft, oldVolumeRight;    // Previous volume levels
  35.  
  36.     // ----------------------------
  37.     // IB Outlets (to be linked in later by IB)
  38.     // ----------------------------
  39.     
  40.     // Other global objects
  41.     id     cassandra;        // The Cassandra object (controls
  42.                     // most everything)            
  43.     id     global;            // The global object (holds the user
  44.                     // preferences and system globals)
  45.     
  46.     // -------------------------------------
  47.     // Panel Objects (Buttons, forms, etc.)
  48.     // -------------------------------------
  49.  
  50.     id    eventTypeRadioMatrix;
  51.     
  52.     id    amPmButton;        // The am/pm button
  53.     id    dayForm;        // Holds the current day
  54.     id    monthForm;        //  "     "    "     month
  55.     id    yearForm;        //  "     "    "     year
  56.     id    hourForm;        //  "     "    "     hour
  57.     id    minuteForm;        //  "     "    "     minute
  58.     id    wdayTextField;        // Displays the day of the week:
  59.                     // Sun, Mon, Tues ....
  60.     id    dateRadioMatrix;    // Holds the radio matrix that
  61.                     // controls what the date up/down
  62.                     // buttons control.
  63.     id     testDateTextField;    // The little TextField that shows
  64.                     // the user what Cassandra thinks
  65.                     // the date/time really is:
  66.                     //  Sun Jan 23, 1990   4:30pm etc....
  67.     
  68.     id    durationButton;
  69.     id    durationRadioMatrix;
  70.     id    durationUpButton;
  71.     id    durationDownButton;
  72.     id    durationMinuteForm;
  73.     id    durationHourForm;
  74.     
  75.     
  76.     
  77.     id    anniversaryButton;    // Buttons that controls whether
  78.                     // anniversaries are enabled
  79.     id    anniversaryForm;    // Holds the intervals of annvs.
  80.                     // i.e.  Every  xxxx days
  81.     id    anniversaryRadioMatrix;    // Controls the interval constant of
  82.                     // annvs.  Every 10 days, months, etc.
  83.     id    anniversaryDownButton;    // These two buttons let the user
  84.     id    anniversaryUpButton;    // control the interval by mouse.
  85.                     // We need to disable them sometimes.
  86.     id     everyTextField;        // This text field is right next
  87.                     // to the anniversaryForm and lets
  88.                     // the user verify the interval
  89.                     // constant:  Every 10 days, months,
  90.     id    testAnniversaryTextField;    // A little TextField that
  91.                     // shows the user what Cassandra
  92.                     // thinks the current anniversary
  93.                     // setting is at.
  94.                     
  95.     
  96.     id    snoozeButton;
  97.        id    snoozeNoForm;
  98.     id    snoozeIntForm;
  99.     id    snoozeIntUpButton;
  100.     id    snoozeIntDownButton;
  101.     id    snoozeNoUpButton;
  102.     id    snoozeNoDownButton;
  103.     id     snoozeTimesTextField;
  104.     id     snoozeMinutesTextField;
  105.     id    testSnoozeTextField;
  106.     
  107.     id    alarmSoundRadioMatrix;    // The radio matrix that controls
  108.                             // whether we have a sound or not
  109.     id    alarmSoundForm;        // The form that holds the sound's
  110.                     // path
  111.     id    setButton;        // The set, play, and stop buttons.
  112.     id    playButton;        // We need these outlets so we can
  113.     id    stopButton;        // disable these buttons at times.
  114.  
  115.     id    priorityRadioMatrix;    // The radio matrix of priorities.
  116.                     // Currently High, Medium, Low.
  117.                     // These get translated to the
  118.                     // appropriate Event priorities
  119.                     // (numerically from 1 - 100)
  120.     
  121.     id    messageButton;        // Show Message?
  122.     id    messageForm;        // The form for the actual message
  123.  
  124. }
  125.  
  126. // ----------------
  127. // Instance methods
  128. // ----------------
  129.  
  130. // ---------------
  131. // Window controls    
  132. // ---------------
  133.  
  134. // Method Name:        - open: sender
  135. // Description:        Opens the panel. It first allocates the objects
  136. //            it needs, sets the default values and then displays
  137. //            them.
  138. - open:sender;            
  139.  
  140.  
  141. // Method Name:        - close
  142. // Description:        Closes the panel. If there had been any changes
  143. //            made, it asks the user if they really want to close
  144. //            then panel. If so, it frees the objects it used
  145. //            and closes the panel.
  146. - close;
  147.  
  148.  
  149. // Method Name:        - startOver: sender
  150. // Description:        This is usually linked to the target of the
  151. //            Start Over button. It resets all the values
  152. //            to their defaults and re-displays the screen.
  153. - startOver: sender;
  154.  
  155.  
  156. // Method Name:        - resetDefaultValues: sender
  157. // Description:        Resets all of the present Event's values to their
  158. //            defaults (as defined by the method itself and
  159. //            with the global values).
  160. - resetDefaultValues:sender;
  161.  
  162.  
  163. // Method Name:        - displayValues: sender
  164. // Description:        Redraws the panel with the current values of the
  165. //            current Event.
  166. - displayValues:sender;
  167.  
  168.  
  169. - displayDate: sender;        // Update the date forms
  170.  
  171. - dateFinished: sender;        // Called by IB. The user has finished 
  172.                 // with the date
  173.                 
  174. - (struct tm*) getDate: sender;        // Read the date off the
  175.                     // date forms, fix user errors
  176.                     // and return the date
  177.     
  178. - updateTestDate : (struct tm *) timeNow;    // Update the text field
  179.                     // that gives feed back on the user
  180.                     // actions
  181.                     
  182.                 
  183. - selectNextText:sender;        // Select the nextText of the sender
  184.                     // Workaround since NeXT didn't
  185.                     // provide an accessor
  186.  
  187.  
  188. - insertEventAndClose:sender;        // Insert the event and close the
  189.                     // panel
  190.                     
  191. - insertEvent:sender;            // Just insert the event
  192.  
  193. - dateUp: sender;            // Move the date/time forms up or
  194. - dateDown: sender;            // down one (dependent on the
  195.                     // radio matrix setting)
  196.  
  197. - sound: sender;            // Sound activated/deactivated
  198. - playSound:sender;            // Play the sound
  199. - stopSound:sender;            // Stop playing the sound
  200. - setSound:sender;            // Set the sound
  201. - checkSound:sender;            // Check to see if user has valid
  202.                     // sound path
  203.  
  204. - message: sender;            // Message enabled/disabled
  205. - messageFinished: sender;        // User has finished with message
  206.  
  207. - anniversary:sender;            // Anniversary enabled/disabled
  208. - anniversaryFinished:sender;        // User has finished w/ anniversary
  209. - anniversaryUp:sender;            // Move anniversary up or 
  210. - anniversaryDown: sender;        // down one
  211.  
  212. - snooze:sender;            // Snooze enabled/disabled
  213. - snoozeFinished: sender;        // User has finished w/ snooze
  214. - snoozeIntUp: sender;            // Move snooze interval up or 
  215. - snoozeIntDown: sender;        // down one
  216. - snoozeNoUp: sender;            // Move snooze number up or down
  217. - snoozeNoDown: sender;            // one
  218. @end
  219.